home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cuj9205.zip / 1005076A < prev    next >
Text File  |  1992-06-02  |  384b  |  22 lines

  1. /*
  2.  *    main.c - main to test the stack abstraction
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include <assert.h>
  7. #include <stack.h>
  8.  
  9. char    *some_pointer = "some data";
  10.  
  11. void    main() {
  12. STK    *stk;
  13.  
  14.     stk = StkConstruct();
  15.     assert(StkIsEmpty(stk));
  16.     StkPush(stk, some_pointer);
  17.     assert(!StkIsEmpty(stk));
  18.     assert(StkPop(stk) == some_pointer);
  19.     assert(StkIsEmpty(stk));
  20.     StkDestroy(stk);
  21. }
  22.